using System;

namespace BeeldBank.Data
{
	/// <summary>
	/// The Exception that is thrown when a user attempts to delete a record that is referenced by a record (usually) in an other table.
	/// </summary>
	public class DeleteConstraintException : ApplicationException
	{
		public DeleteConstraintException(string referencingTableName) : base()
		{
			_referencingTableName = referencingTableName;
		}
		public DeleteConstraintException(string referencingTableName, string message) : base(message)
		{
			_referencingTableName = referencingTableName;
		}
		public DeleteConstraintException(string referencingTableName, string message, System.Exception inner) : base(message,inner)
		{
			_referencingTableName = referencingTableName;
		}

		private string _referencingTableName;
		/// <summary>
		/// Gets the name of the table that contains the record that causes the contraint to fail.
		/// </summary>
		public string ReferencingTable
		{
			get
			{
				return _referencingTableName;
			}
		}

	}
}
